﻿<%@ Page Title="Problem List" Theme="POSSystem" Language="C#" MasterPageFile="~/EditPages/Popup.Master" AutoEventWireup="true" CodeBehind="ProblemList.aspx.cs" Inherits="WebUI.EditPages.ProblemList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="PopupHeadHolder" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PopupToolbarHolder" runat="server">
    <script type="text/javascript">
        function onRemoveModel() {
            return confirm("Are you sure to delete selected item?");
        }

        function onSelect() {
            var lst = document.getElementById("<%=lstCategory.ClientID %>");
  
            if (lst.selectedIndex < 0)
                return;
            var value = lst.options[lst.selectedIndex].value;
            document.getElementById("<%=hidSelectedID.ClientID %>").value = value;
            document.getElementById("<%=btnLoad.ClientID %>").click();
        }
    </script>

    <table class="popuptoolbar" width="100%">
        <tr>
            <td style="vertical-align:middle; text-align:left">
                <asp:LinkButton class="tbbutton" ID="btnNew" runat="server" OnClientClick="window.close(); return false;">
                    <img src="Images/CloseButton.gif" /><asp:Label ID="label5" runat="server" Text="Close"></asp:Label>
                </asp:LinkButton>
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PopupContentHolder" runat="server">
     <div>
        <table width="850px">
            <tr>
                <td style="vertical-align:top; text-align:left" >
                    <table class="toolbar" width="420px">
                        <tr>
                            <td style="vertical-align:top; text-align:left">
                                <asp:LinkButton ValidationGroup="AddCat" class="tbbutton" ID="btnAddCat" runat="server" OnClick="btnAddCat_OnClick" >
                                    <asp:Image ID="Image1" runat="server" ImageUrl="~/Images/AddRecord.gif" /><asp:Label
                                        ID="label1" runat="server" Text="New Prob.Type" ToolTip="Type Problem-Type name into textbox then click Add"></asp:Label>
                                </asp:LinkButton>
                                <asp:TextBox ID="txtCatName" runat="server" Width="150px" ></asp:TextBox>
                                <asp:RequiredFieldValidator ValidationGroup="AddCat" ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtCatName" Display="Dynamic" CssClass="requiredField"
                                    ErrorMessage="required" Text="required"></asp:RequiredFieldValidator>
                                <asp:LinkButton class="tbbutton" ID="btnDeleteCat" OnClientClick="return onRemoveModel();" runat="server" OnClick="btnDeleteCat_OnClick">
                                    <asp:Image ID="Image3" runat="server" ImageUrl="~/Images/Delete.gif" /><asp:Label
                                        ID="label2" runat="server" Text="Delete" ToolTip="Delete selected Problem Type" ></asp:Label>
                                </asp:LinkButton>
                            </td>
                        </tr>
                    </table>
                    <asp:ListBox onclick='onSelect();' SelectionMode="Multiple" ID="lstCategory" runat="server" Width="100%" Height="470px"  ></asp:ListBox>
                    <asp:Label ID="lblNote" runat="server" class='labelNote' Text="(*) e.g Unlock, Hardware, Software, LCD, Ribbon Cable... "></asp:Label>
                </td>
                <td style='vertical-align:top; width:430px'>
                    <table class="toolbar" width="100%">
                        <tr>
                            <td style="vertical-align:middle; text-align:left">
                                <asp:LinkButton ValidationGroup="Add" class="tbbutton" ID="btnAdd" runat="server" OnClick="btnAdd_OnClick" >
                                    <asp:Image ID="img1" runat="server" ImageUrl="~/Images/AddRecord.gif" /><asp:Label
                                        ID="label4" runat="server" Text="New Problem" ToolTip="Type problem description into textbox then click Add"></asp:Label>
                                </asp:LinkButton>
                                <asp:TextBox ID="txtName" runat="server" Width="150px" ></asp:TextBox>
                                <asp:RequiredFieldValidator ValidationGroup="Add" ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtName" Display="Dynamic" CssClass="requiredField"
                                    ErrorMessage="required" Text="required"></asp:RequiredFieldValidator>
                                <asp:LinkButton class="tbbutton" ID="btnDelete" OnClientClick="return onRemoveModel();" runat="server" OnClick="btnDelete_OnClick">
                                    <asp:Image ID="Image2" runat="server" ImageUrl="~/Images/Delete.gif" /><asp:Label
                                        ID="label3" runat="server" Text="Delete" ToolTip="Delete selected problems" ></asp:Label>
                                </asp:LinkButton>
                            </td>
                        </tr>
                    </table>
                    <asp:UpdatePanel ID="updateProblem" runat="server" UpdateMode="Conditional">
                        <ContentTemplate>
                            <asp:ListBox SelectionMode="Multiple" ID="lstProblems" runat="server" Width="100%" Height="470px"  ></asp:ListBox>
                            <asp:Label ID="Label6" runat="server" class='labelNote' Text="(*) Just a list of problem definition. Every model has its own price for each problem. Set problem-price for a specific model, go to Quotation section. "></asp:Label>
                            <asp:Button ID="btnLoad" runat="server" OnClick="btnLoad_OnClick" style='display:none' />
                            <asp:HiddenField ID="hidSelectedID" runat="server" />
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
